package com.bicon.botu.mall.base.api;


import com.bicon.botu.mall.base.common.MallHomePageConstants;
import com.bicon.botu.mall.base.dto.CarefullyChosenDto;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import com.bicon.botu.mall.base.service.ICarefullyChosenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 为你精选 前端控制器
 *
 * @author 张凡
 * @date 2017/7/19 下午 14:49
 */
@RestController
@CrossOrigin
@RequestMapping("/V1.0.0/api/carefullyChosen")
public class CarefullyChosenApi extends BaseController {
    @Autowired
    ICarefullyChosenService iCarefullyChosenService;


    /**
     * 获取为你精选图详情
     *
     * @return
     */
    @RequestMapping(value = "/getCarefullyChosenDetailFromRedis", method = RequestMethod.GET)
    public BaseResult getCarefullyChosenDetailFromRedis() {
        CarefullyChosenDto carefullyChosen = iCarefullyChosenService.getCarefullyChosenDetailFromRedis();
        return new BaseResult(MallHomePageConstants.RESPONSE_CODE_200, MallHomePageConstants.RESPONSE_MESSAGE_200, carefullyChosen);
    }
}
